const { showToast } = require("../../utils/util")
const app = getApp()
// components/ng-step/index.js
Component({
  properties: {

    active: {
      type: Number,
      value: 0,
    },
    showStep: {
      type: Boolean,
      value: true,
    },
    btnText: {
      type: String,
      value: app.data.$language.l98 
    },
    isNext: {
      type: Boolean,
      value: false
    }
  },
  methods: {
  	onNextStepHandle() {
  		if (!this.data.isNext) {
        let url = ''
        if (this.data.active === 1) {
          url = `/subpackages/custom/step3/index`
        
        } else if (this.data.active === 2) {
          url = `/subpackages/custom/doing/index`
            //喜欢的香气
          if(app.data.customData.incenseBaseIds==''){
            showToast('请选择喜欢的气味')
            return
          }
        }else{
          url = `/subpackages/custom/step2/index`
          // 喜欢的香水
          if(app.data.customData.perfumeIds==''){
            showToast('请选择喜欢的香水')
            return
          }
        }
        wx.navigateTo({ url })
      } else {
        this.triggerEvent('next')
      }
  	}
  }
})
